<?php
/**
 * Created by PhpStorm.
 * User: zhengze
 * Date: 2019/7/1
 * Time: 18:29
 */

namespace app\api\validate;

use app\api\enum\ScopeEnum;
use app\api\service\Token;
use common\traits\InstanceTrait;
use app\lib\exception\TokenException;

/**
 * Class AdminValidate
 * 验证类的基类
 */
class PlanValidate extends \common\validate\BaseValidate
{
    use InstanceTrait;

    /**
     * 定义验证规则
     * 格式：'字段名|字段中文名'    =>    ['规则1','规则2'...]
     * @var array
     */
    protected $rule = [
        'plan_id|plan_id' => ['require',],
        'finish_time|日期' => ['require',],
        'content|内容' => ['require',],
        'cycle|周期(天)' => ['require',],
    ];

    protected $sceneRule = [
        'getInfo' => [
            'only' => ['plan_id'],
        ],
        'save' => [
            'only' => ['content', 'cycle'],
        ],
        'delete' => [
            'only' => ['plan_id'],
        ],
        'finish' => [
            'only' => ['plan_id'],

        ],
    ];

    /**
     * 处理RegisterVerify场景
     */
    public function sceneLogin()
    {
        $this->loadScene(__FUNCTION__);
    }


}